package com.implementsystem.prestacontas.orgaos.session;

import java.util.List;

import javax.ejb.EJB;
import javax.ejb.Stateless;

import com.implementsystem.prestacontas.geral.session.GenericSession;
import com.implementsystem.prestacontas.orgaos.dao.OrgaoDao;
import com.implementsystem.prestacontas.orgaos.entity.Orgao;

@Stateless
public class OrgaoSession extends GenericSession<Orgao>{

	private static final long serialVersionUID = 3237800218347219033L;
	
	@EJB
	private OrgaoDao dao;
	
	public List<Orgao> findAllOrderByDescricao(){
		return dao.findAllOrderByDescricao();
	}
	
	public boolean findByCodigoOrgao(Orgao org){
		
		Orgao orgao = dao.findByCodigoOrgao(org.getCodigoOrgao());
		
		if(orgao != null && orgao.getCodigoOrgao() != null){
			return true;
		}else {
			return false;
		}
	}
	
}
